package com.sky.controller.admin;

import com.sky.result.Result;
import com.sky.service.ShopService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author wuJiaWei
 * @version 1.0
 */
@RestController
@RequestMapping("/admin/shop")
@Api(tags = "店铺管理")
@Slf4j
public class ShopController {
    @Autowired
    private ShopService shopService;

    @PutMapping("/{status}")
    public Result<T> startOrStop(@PathVariable Integer status) {
        log.info("店铺状态修改");
        shopService.startOrStop(status);
        return Result.success();
    }

    @GetMapping("/status")
    public Result<Integer> status() {
        log.info("店铺状态获取");
        return Result.success(shopService.status());
    }
}
